package com.mdd.service.impl;

import com.mdd.domain.User;
import com.mdd.mapper.UserMapper;
import com.mdd.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public Integer addUser(User user) {
        System.out.println("业务层正在做添加用户操作！");
        return userMapper.addUser(user);
    }

    @Override
    public List<User> selectAll() {
        System.out.println("业务层正在做查询所有用户操作！");
        return userMapper.selectAll();
    }

    @Override
    public User selectById(int id) {
        System.out.println("业务层正在做查询某个用户操作！");
        return userMapper.selectById(id);
    }

    @Override
    public Integer updateById(User user) {
        System.out.println("业务层正在做修改用户操作！");
        return userMapper.updateById(user);
    }

    @Override
    public Integer deleteById(int id) {
        System.out.println("业务层正在做删除用户操作！");
        return userMapper.deleteById(id);
    }
}
